<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//
if( file_exists('stop.php') ) {
	//include_once('stop.php');
}

//
require(dirname(dirname(__FILE__)) . '/includes/application_top.php');

//
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'module/content/content.class.php');
$mObj = new ContentBase();
$mObj->format = true;
$mObj->filter_fields[] = 'link:=';

//
$prefix = util_get_param($_REQUEST, 'p');
$cid = util_get_param($_REQUEST, 'cid');

//
$items = $mObj->getItems(array('link:=' => '', 'cid' => $cid), -1, false);
for($i=0, $n=sizeof($items); $i<$n; $i++) {
	$mObj->_generate_item_link($items[$i]['id'], (($prefix == '') ? '' : $prefix . '-') . $items[$i]['subject']);
}

//
echo 'OK';
//
?>